package com.fancyy.scm.util;

import android.app.ProgressDialog;
import android.content.Context;
import android.os.Build;

/**
 * Created by curry on 2017/9/4.
 */

public class ProgressUtil {

    public static ProgressDialog mProgressDialog;

    public static void showProgress(Context context, String message) {
        mProgressDialog = new ProgressDialog(context);
        if (Build.VERSION.SDK_INT >= 21) {
            mProgressDialog.setProgressStyle(android.R.style.Theme_Material_Light_Dialog);
        }
        mProgressDialog.setMessage(message);
        mProgressDialog.setCancelable(false);
        mProgressDialog.show();
    }

    public static void dismissProgress() {
        if (mProgressDialog != null && mProgressDialog.isShowing()) {
            mProgressDialog.cancel();
        }
    }
}
